package com.loongtech.bi.advertisment.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.loongtech.bi.dao.CommonDao;
import com.loongtech.bi.advertisment.service.AdvUserDataService;

@Service("advUserDataService")
public class AdvUserDataServiceImpl implements AdvUserDataService {

	@Resource(name = "commonDao")
	private CommonDao commonDao;

	@Override
	public int getVipLevel(int state) throws Exception {
		int reval = 0;
		StringBuilder sql = new StringBuilder();
		sql.append("select adv_value from bi_adv_type_value where adv_type = " + state + " ");
		List<List<String>> re = commonDao.queryListData(sql.toString(), null);
		if (re.get(0) == null || re.get(0).get(0) == null) {
			reval = 6;
		} else {
			reval = Integer.valueOf(re.get(0).get(0));
		}
		return reval;
	}
}
